/**
 * 
 */
package com.googlecode.easyibatis.core.service;

import java.io.Serializable;
import java.util.Collection;
import java.util.Map;

import com.googlecode.easyibatis.core.exception.EasyIbatisException;
import com.googlecode.easyibatis.core.utils.Sort;


/**
 * @author zxq
 * 
 */
public interface ServiceSupport<T, PK extends Serializable> {
	// void delete(PK id) throws EasyIbatisException;

	void delete(T model) throws EasyIbatisException;

	Collection<T> findAll() throws EasyIbatisException;

	Collection<T> findAllByFilter(Map<String, ?> equalsFilter, Map<String, ?> likeFilter, Sort... sorts)
			throws EasyIbatisException;

	Collection<T> findAllByFilter(Map<String, ?> equalsFilter, Map<String, ?> likeFilter, Integer start, Integer limit,
			Sort... sorts) throws EasyIbatisException;

	T findById(PK id) throws EasyIbatisException;

	PK save(T model) throws EasyIbatisException;

	Long total() throws EasyIbatisException;

	Long totalByFilter(Map<String, ?> equalsFilter, Map<String, ?> likeFilter) throws EasyIbatisException;

	void update(T model) throws EasyIbatisException;
}
